﻿<!DOCTYPE html>
<!--重大隐患信息录入-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <link href="/static/js/vue-treeselect/vue-treeselect.css" rel="stylesheet" />
    <script src="/static/js/vue-treeselect/vue-treeselect.js"></script>
    <script>

    </script>
    <style>
        .popupW100 .el-input-group__prepend {}
    </style>
    <style>
        .vue-treeselect__control {
            height: 100%;
            border: none;
            background: none;
        }

        .vue-treeselect__placeholder {
            top: -3px;
        }

        .vue-treeselect__single-value {
            top: -3px;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak class="popupW100">
        <el-row>
            <el-col :span="24">
                <el-form label-position="right" ref="form" :inline="true" :model="formInline" class="demo-form-inline"
                    style="margin-bottom: 15px;">

                    <el-row>
                        <el-col class="head-tool">
                            
<div class="new_title fl"><strong><img
                                        src="/static/images/icon1.png" />重大隐患信息录入及整改负责人选择列表</strong>
                            </div>

                            <span>
                                <btn :text="col.btnSelect" imgsrc="/static/images/search.png" linetype="3"
                                    @click="onSubmit"></btn>
                                <btn :text="col.btnSave" imgsrc="/static/images/general.png" linetype="3"
                                    @click="onSubmit"></btn>
                                <btn :text="col.btnInfoInput" imgsrc="/static/images/general.png" linetype="4"
                                    @click="UserInput('tj')"></btn>
                            </span>
                        </el-col>
                    </el-row>
                    <el-row>

                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input v-model="formInline.model.Discoverer"
                                        :placeholder="RisksManagement.MajorRiskDossier.Discoverer" size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.MajorRiskDossier.Discoverer+mark.m}}
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                        <!--<el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">
        <div class="elst-select-mini">
            <el-form-item>
                <el-input v-model="formInline.model.DiscoveryTime" :placeholder="RisksManagement.MajorRiskDossier.DiscoveryTime" size="mini">
                    <template slot="prepend">
                        {{RisksManagement.MajorRiskDossier.DiscoveryTime+mark.m}}
                    </template>
                </el-input>
            </el-form-item> 
        </div>
    </el-col>-->
                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.MajorRiskDossier.RiskType+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.RiskType" slot="suffix"
                                            :placeholder="RisksManagement.MajorRiskDossier.RiskType">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in RiskType" :label="item.value" :value="item.key">
                                            </el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.MajorRiskDossier.RiskLevel+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.RiskLevel" slot="suffix"
                                            :placeholder="RisksManagement.MajorRiskDossier.RiskLevel">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in RiskLevel" :label="item.value" :value="item.key">
                                            </el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.MajorRiskDossier.ReportType+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.ReportType" slot="suffix"
                                            :placeholder="RisksManagement.MajorRiskDossier.ReportType">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in ReportType" :label="item.value" :value="item.key">
                                            </el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>

                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.MajorRiskDossier.RectificationLeading+mark.m}}
                                        </template>
                                        <treeselect v-model="formInline.model.RectificationLeading"
                                            :options="RectificationLeading" :flat="true" :show-count="true"
                                            :disable-branch-nodes="true" slot="suffix" placeholder="请选择"
                                            style="line-height: 28px;width: 54%;float: right;" />
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>

                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.MajorRiskDossier.DiscoveryTime+'开始'+mark.m}}
                                        </template>
                                        <el-date-picker v-model="formInline.model.DiscoveryTimeBegin" type="date"
                                            slot="suffix" size="mini" placeholder="选择日期">
                                        </el-date-picker>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.MajorRiskDossier.DiscoveryTime+'结束'+mark.m}}
                                        </template>
                                        <el-date-picker v-model="formInline.model.DiscoveryTimeEnd" type="date"
                                            slot="suffix" size="mini" placeholder="选择日期">
                                        </el-date-picker>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>


                    </el-row>
                </el-form>
                <el-table stripe ref="table" :data="ListItem.tableData" :height="ListItem.tableHeight" border
                    @selection-change="handleSelectionChange" row-style="height:10px" style="width: 100%">
                    <el-table-column type="selection" align="center" width="55">
                    </el-table-column>
                    <el-table-column type="index" :label="RisksManagement.MajorRiskDossier.id" :index="indexMethod"
                        width="50"></el-table-column>
                    <el-table-column prop="troubleNum" :formatter="getDicValue" min-width="130"
                        show-overflow-tooltip="true" :label="RisksManagement.RiskReport.troubleNum">
                    </el-table-column>
                    <el-table-column prop="Discoverer" width="80" show-overflow-tooltip="true"
                        :label="RisksManagement.MajorRiskDossier.Discoverer">
                    </el-table-column>
                    <el-table-column prop="OrganizationType" :formatter="getDicValue" min-width="100"
                        show-overflow-tooltip="true" :label="RisksManagement.MajorRiskDossier.OrganizationType">
                    </el-table-column>
                    <el-table-column prop="DiscoveryTime" min-width="170" show-overflow-tooltip="true"
                        :label="RisksManagement.MajorRiskDossier.DiscoveryTime">
                    </el-table-column>
                    <el-table-column prop="InspectType" :formatter="getDicValue" min-width="100"
                        show-overflow-tooltip="true" :label="RisksManagement.MajorRiskDossier.InspectType">
                    </el-table-column>
                    <el-table-column prop="RiskRegion" :formatter="getDicValue" min-width="110"
                        show-overflow-tooltip="true" :label="RisksManagement.MajorRiskDossier.RiskRegion">
                    </el-table-column>
                    <el-table-column prop="RiskPosition" :formatter="getDicValue" min-width="100"
                        show-overflow-tooltip="true" :label="RisksManagement.MajorRiskDossier.RiskPosition">
                    </el-table-column>
                    <el-table-column prop="RiskType" :formatter="getDicValue" min-width="100"
                        show-overflow-tooltip="true" :label="RisksManagement.MajorRiskDossier.RiskType">
                    </el-table-column>
                    <el-table-column prop="RiskLevel" :formatter="getDicValue" show-overflow-tooltip="true"
                        min-width="90" :label="RisksManagement.MajorRiskDossier.RiskLevel">
                    </el-table-column>
                    <el-table-column prop="ReportType" :formatter="getDicValue" show-overflow-tooltip="true"
                        :label="RisksManagement.MajorRiskDossier.ReportType">
                    </el-table-column>
                    <el-table-column prop="RectificationLeading" :formatter="getDicValue" show-overflow-tooltip="true"
                        min-width="110" :label="RisksManagement.MajorRiskDossier.RectificationLeading">
                    </el-table-column>
                    <el-table-column width="100" prop="update" :label="col.btnOperate" fixed="right">
                        <template slot-scope="scope">
                            <button type="button" class="elst-bt-xg" @click=UserInput('xg',scope.row.id)
                                :title="col.btnUpdate">
                                <i class="el-icon-edit"></i>
                            </button>
                            <button type="button" class="elst-bt-xg" @click=UserInput('ck',scope.row.id)
                                :title="col.btnCheck">
                                <i class="el-icon-search"></i>
                            </button>
                        </template>
                    </el-table-column>
                </el-table>
                <el-row type="flex" justify="end">
                    <el-pagination ref="page" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                        :current-page="ListItem.currentPage" :page-sizes="ListItem.pagesizes"
                        :page-size="ListItem.pagesize" :layout="ListItem.layout" :total="ListItem.total">
                    </el-pagination>
                </el-row>
            </el-col>
        </el-row>
        <el-dialog :title="dialogTitle" fullscreen="true" :visible.sync="ListItem.dialogVisible" @close='closeDialog'
            width="80%" height="80%" top="10vh">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        Vue.component('treeselect', VueTreeselect.Treeselect)
        app = new Vue({
            el: '#app',
            data: function () {
                return {
                    dialogTitle: '重大隐患项目档案',
                    Region: myTree,
                    mydata: PersonInChargeTree,
                    //页面内左树
                    RiskLevel: [],
                    RiskType: [],
                    ReportType: [],
                    RectificationLeading: [],
                    //页面内数据初始化
                    ListItem: ListItem,
                    formInline: {
                        model: {
                            Discoverer: '',
                            DiscoveryTimeBegin: '',
                            DiscoveryTimeEnd: '',
                            RiskType: '',
                            RiskLevel: '',
                            ReportType: '',
                            RectificationLeading: null,
                        },
                        offset: 0,
                        limit: 10
                    }
                }
            },
            created: function () {
                var currApp = this;
                window.onresize = function () {
                    currApp.ListItem.tableHeight = window.innerHeight -
                        currApp.$refs.table.$el.offsetTop - 60;
                    if (currApp.ListItem.tableHeight < 112) {
                        currApp.ListItem.tableHeight = 112;
                    }
                }
            },
            mounted: function () {
                //获取下拉菜单内容
                this.RiskLevel = getDicData('03');//字典内容
                this.RiskType = getDicData('100');
                this.ReportType = getDicData('102');
                this.RectificationLeading = fn(this.mydata, "0");
                //初始化数据
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //表格序号连续化
                indexMethod: function (index) { return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1; },
                getDicValue: function (row, column, cellValue, index) {
                    switch (column.property) {

                        case "OrganizationType":
                            return getDicValue('103', cellValue)
                            break;
                        case "InspectType":
                            return getDicValue('101', cellValue)
                            break;
                        case "RiskType":
                            return getDicValue('100', cellValue)
                            break;
                        case "ReportType":
                            return getDicValue('102', cellValue)
                            break;
                        case "RiskLevel":
                            return getDicValue('03', cellValue)
                            break;
                        case "RiskRegion":
                            return getTreeValue(this.Region, cellValue); break;
                        case "RectificationLeading":
                            return getTreeValue(this.mydata, cellValue); break;
                        case "RiskPosition":
                            return getTreeValue(this.Region, cellValue); break;
                        case "ApprovalResult":
                            return getDicValue('130', cellValue)
                            break;
                        default:
                            return cellValue; break;
                    }

                },
                closeDialog: function () { closeDialog(this); },
                //删除方法
                onDelete: function () { onDelete(this, '/api/MajorRiskDossier/DeleteMuti'); },
                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //Dialog展示
                UserInput: function (val, id) {
                    if (val == "ck") {
                        this.ListItem.InputUrl = "MajorRiskDossierInput.html?type=ck&id=" + id + "&t=" + Date.parse(new Date());
                        this.ListItem.dialogVisible = true;
                    }
                    else {
                        DialogShow(this, val, "MajorRiskDossierInput.html", id);
                    }
                },
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/MajorRiskDossier/GetList') },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); }
            }
        });

    </script>
</body>

</html>